<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>系统日志查询</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        .laytable-cell-1-log_content{text-align: left !important;}
        table thead tr th div,.layui-table-body .layui-table tbody tr .log_content,table tbody tr td div{text-align: left !important;}
        table tbody tr td .laytable-cell-numbers{text-align: center !important;}
    </style>
</head>
<body>
<form class="layui-form layui-form-pane" id="form_7grid" action="" >
    <div class="formTop">
        <div class="layui-input-inline layui-col-lg3 layui-col-md3 layui-col-xs3">
            <div class="layui-input-inline" style="width:80%;">
                <select name="compid" lay-verify="required" lay-search="">
                    <option value="">请选择企业</option>

                </select>
            </div>
        </div>

        <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs3">
            <div class="layui-input-inline"  style="width:80%;">
                <input type="text" class="layui-input" id="test-limit3" placeholder="请选择操作开始日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="layui-inline layui-col-lg3 layui-col-md3 layui-col-xs3">
            <div class="layui-input-inline"  style="width:80%;">
                <input type="text" class="layui-input" id="test-limit4" placeholder="请选择操作结束日期">
                <div class="icons">

                </div>
            </div>
        </div>
        <div class="_sum layui-col-lg3 layui-col-md3 layui-col-xs3">
            <button class="layui-btn tijiao" type="button" onclick="logQueryajaxs()">查询</button>

        </div>
    </div>
    <table id="demo" lay-filter="test"></table>

    <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-mini" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-mini" lay-event="del">删除</a>
    </script>

</form>
<a class="dayin" type="button" id="dlink" onclick="" style="float: right; position: fixed; right: 50px; bottom: 50px; z-index: 999;"></a>

<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>

<script>
     function logQueryajaxs() {
        var compid=$('[name="compid"]').val();
        var begintime=$('#test-limit3').val();
        var endtime=$('#test-limit4').val();


         if(!AntiSqlValid(compid)){
             if(lbq('api/admin/loadLog.do')){
             API.Journalajaxs({'compid':compid,'begintime':begintime,'endtime':endtime,'p':getCookie('yanzheng')})
             }
         }else {
             layer.msg('请勿输入特殊符号或敏感文字');
         };


    }

    layui.use(['form', 'layedit', 'laydate','table','element'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,table=layui.table
            ,element=layui.element;
        jiazais();


        $('.demoTable .layui-btn').on('click', function(){
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });

//        ajaxs('/api/public/loadPriDropDown.do','post',{'type':'a'},function (data) {
//            console.log(data)
//            var datas=data.data;
//            for(var i=0;i<datas.length;i++){
//                $('[name="compid"]').append(' <option value="'+datas[i].compid+'">'+datas[i].compName
//                    +'</option>')
//            }
//            form.render('select');
//
//        })
        if(lbq('api/admin/loadLog.do')) {

            API.Journalajaxs({'p': getCookie('yanzheng')}, function () {
                //console.log(arguments, '坏笑');
                var ts = arguments[0].allcomp;
                //console.log(ts)
                for (var i = 0; i < ts.length; i++) {
                    $('[name="compid"]').append(' <option value="' + ts[i].compid + '">' + ts[i].compName + '</option>')
                }
                form.render();

            })      //调用页面数据查询 渲染
        }
        //前后若干天可选，这里设置不能选过去的日期      最远可选1000天之后
        panduanshijiantow('#test-limit3','#test-limit4',1000,1000,'.tijiao');     //查询 开始结束时间判断
        dayintishi('.dayin');

        //监听工具条
        table.on('tool(test)', function(obj){ //注：tool是工具条事件名，test是table原始容器的属性 lay-filter="对应的值"
            var data = obj.data; //获得当前行数据
            var layEvent = obj.event; //获得 lay-event 对应的值
            var tr = obj.tr; //获得当前行 tr 的DOM对象

            if(layEvent === 'detail'){ //查看
                //do somehing
            } else if(layEvent === 'del'){ //删除
                layer.confirm('确认删除？', function(index){
                    obj.del(); //删除对应行（tr）的DOM结构，并更新缓存
                    layer.close(index);
                    //向服务端发送删除指令
                });
            } else if(layEvent === 'edit'){ //编辑
                //do something
//                window.location.href='http://www.baidu.com'

            }
        });



    })

</script>
</body>
</html>